package com.gexiaobao.pigeon.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.gexiaobao.pigeon.R
import com.gexiaobao.pigeon.app.base.DataBindBaseViewHolder
import com.gexiaobao.pigeon.app.model.bean.AddressListResponse
import com.gexiaobao.pigeon.databinding.ItemReceiveAddressBinding

/**
 * @author:hxw
 * @date  :2023/1/10
 * @desc  :
 */
class ReceiveAddressAdapter(mData: ArrayList<AddressListResponse.ListBean>) :
    BaseQuickAdapter<AddressListResponse.ListBean, DataBindBaseViewHolder>(R.layout.item_receive_address, mData) {

    private var mIsHide = false

    override fun convert(holder: DataBindBaseViewHolder, item: AddressListResponse.ListBean) {
        val binding = DataBindBaseViewHolder.getBinding(holder) as ItemReceiveAddressBinding
        binding.data = item
        binding.executePendingBindings()//防止列表抖动

        holder.setGone(R.id.ivAddressEdit, mIsHide)
    }

    fun setEditBtnHide(isHide: Boolean) {
        mIsHide = isHide
    }
}